<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>陕西话科普 - 西安文化体验网站</title>
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <header class="header">
        <div class="container">
            <h1 class="logo">西安文化之旅</h1>
            <nav class="nav">
                <ul class="nav-list">
                    <li><a href="index.html" class="nav-link">首页</a></li>
                    <li><a href="food.html" class="nav-link">西安美食</a></li>
                    <li><a href="travel.html" class="nav-link">旅游景点</a></li>
                    <li><a href="poetry.html" class="nav-link">唐诗体验</a></li>
                    <li><a href="dialect.html" class="nav-link active">陕西话</a></li>
                </ul>
            </nav>
        </div>
    </header>

    <main class="main">
        <section class="page-content">
            <div class="container">
                <h1 class="page-title">陕西话科普</h1>
                <p style="text-align: center; font-size: 1.1rem; color: #666; margin-bottom: 3rem;">
                    陕西话是陕西地区的方言，有着浓厚的地方特色和文化底蕴。
                    西安话作为陕西话的代表，既保留了古汉语的韵味，又融入了现代生活的元素。
                </p>

                <!-- 陕西话介绍 -->
                <div class="dialect-intro">
                    <h2 style="color: #764ba2; margin-bottom: 1.5rem;">🗣️ 陕西话特色</h2>
                    
                    <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; margin-bottom: 2rem;">
                        <div style="background: #f8f9fa; padding: 1.5rem; border-radius: 10px; border-left: 4px solid #667eea;">
                            <h3 style="color: #333; margin-bottom: 1rem;">📚 语音特点</h3>
                            <ul style="color: #666; line-height: 1.6;">
                                <li>声调相对平缓，语调起伏不大</li>
                                <li>某些字音与普通话差异较大</li>
                                <li>保留了一些古汉语的读音</li>
                                <li>语速相对较慢，语调亲切</li>
                            </ul>
                        </div>
                        
                        <div style="background: #f8f9fa; padding: 1.5rem; border-radius: 10px; border-left: 4px solid #764ba2;">
                            <h3 style="color: #333; margin-bottom: 1rem;">💬 词汇特色</h3>
                            <ul style="color: #666; line-height: 1.6;">
                                <li>"嫽" - 好、漂亮的意思</li>
                                <li>"咥" - 吃的意思</li>
                                <li>"谝" - 聊天、说话</li>
                                <li>"挣" - 厉害、能干</li>
                            </ul>
                        </div>
                    </div>
                    
                    <div style="background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1)); padding: 2rem; border-radius: 10px;">
                        <h3 style="color: #764ba2; margin-bottom: 1rem;">🎭 文化内涵</h3>
                        <p style="color: #666; line-height: 1.8;">
                            陕西话不仅是一种语言工具，更是陕西文化的重要载体。它承载着陕西人的生活智慧、
                            幽默感和人生哲学。通过学习陕西话，可以更深入地了解陕西的民俗文化和人文精神。
                            陕西话的表达方式往往生动形象，富有感染力，体现了陕西人豪爽、直率的性格特点。
                        </p>
                    </div>
                </div>

                <!-- 音频体验区域 -->
                <div class="audio-section">
                    <h2 style="color: #764ba2; margin-bottom: 2rem; text-align: center;">🎵 陕西话音频体验</h2>
                    <p style="text-align: center; color: #666; margin-bottom: 2rem;">
                        点击播放按钮，听听地道的陕西话是什么样的！
                    </p>
                    
                    <div class="audio-item">
                        <div class="audio-text">
                            <strong>朋友相聚：</strong>"哎！伙计！好久么见咧！看你这一向都嫽滴很么！走，咱兄弟俩寻个地方咥饭去，美美咥一碗泡馍，掰馍谝闲传，你看你这人，嘹咂咧不？"
                        </div>
                        <div class="audio-controls">
                            <button class="play-btn" onclick="toggleAudio('audio1', this)">▶️</button>
                            <div class="audio-progress">
                                <div class="progress-bar" id="progress1"></div>
                            </div>
                            <span class="time-display" id="time1">00:00 / 00:00</span>
                        </div>
                        <audio id="audio1" preload="metadata">
                            <source src="mp3s/哎！伙计！好久么见咧！看你这一向都嫽滴很么！走，咱兄弟俩寻个地方咥饭去，美美咥一碗泡馍，掰馍谝闲传，你看你这人，嘹咂咧不？.mp3" type="audio/mpeg">
                            您的浏览器不支持音频播放。
                        </audio>
                    </div>
                    
                    <div class="audio-item">
                        <div class="audio-text">
                            <strong>美食推荐：</strong>"来，娃，尝一下咱屋这碗油泼面！辣子是自己碾滴，醋是岐山滴，面是刚扯滴，泼一勺子热油，'刺啦'一声，嫽滴太！你咥上一口，保准你香滴说不出话，美滴很！"
                        </div>
                        <div class="audio-controls">
                            <button class="play-btn" onclick="toggleAudio('audio2', this)">▶️</button>
                            <div class="audio-progress">
                                <div class="progress-bar" id="progress2"></div>
                            </div>
                            <span class="time-display" id="time2">00:00 / 00:00</span>
                        </div>
                        <audio id="audio2" preload="metadata">
                            <source src="mp3s/来，娃，尝一下咱屋这碗油泼面！辣子是自己碾滴，醋是岐山滴，面是刚扯滴，泼一勺子热油，‘刺啦’一声，嫽滴太！你咥上一口，保准你香滴说不出话，美滴很！.mp3" type="audio/mpeg">
                            您的浏览器不支持音频播放。
                        </audio>
                    </div>
                    
                    <div class="audio-item">
                        <div class="audio-text">
                            <strong>戏曲赞美：</strong>"额滴个神呀！昨个晚上南门瓮城里的秦腔戏你看了么？那唱滴叫一个挣！吼滴是撕心裂肺，台下人听的如痴如醉，真是嘹咂咧！咱老陕的东西就是嫽！"
                        </div>
                        <div class="audio-controls">
                            <button class="play-btn" onclick="toggleAudio('audio3', this)">▶️</button>
                            <div class="audio-progress">
                                <div class="progress-bar" id="progress3"></div>
                            </div>
                            <span class="time-display" id="time3">00:00 / 00:00</span>
                        </div>
                        <audio id="audio3" preload="metadata">
                            <source src="mp3s/额滴个神呀！昨个晚上南门瓮城里的秦腔戏你看了么？那唱滴叫一个挣！吼滴是撕心裂肺，台下人听的如痴如醉，真是嘹咂咧！咱老陕的东西就是嫽！.mp3" type="audio/mpeg">
                            您的浏览器不支持音频播放。
                        </audio>
                    </div>
                </div>

                <!-- 常用词汇学习 -->
                <div style="background: white; border-radius: 15px; padding: 2rem; margin-top: 3rem; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);">
                    <h2 style="color: #764ba2; margin-bottom: 2rem; text-align: center;">📖 常用陕西话词汇</h2>
                    
                    <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem;">
                        <div style="background: #f8f9fa; padding: 1rem; border-radius: 8px; text-align: center;">
                            <strong style="color: #764ba2;">嫽</strong><br>
                            <span style="color: #666; font-size: 0.9rem;">好、漂亮</span>
                        </div>
                        <div style="background: #f8f9fa; padding: 1rem; border-radius: 8px; text-align: center;">
                            <strong style="color: #764ba2;">咥</strong><br>
                            <span style="color: #666; font-size: 0.9rem;">吃</span>
                        </div>
                        <div style="background: #f8f9fa; padding: 1rem; border-radius: 8px; text-align: center;">
                            <strong style="color: #764ba2;">谝</strong><br>
                            <span style="color: #666; font-size: 0.9rem;">聊天、说话</span>
                        </div>
                        <div style="background: #f8f9fa; padding: 1rem; border-radius: 8px; text-align: center;">
                            <strong style="color: #764ba2;">挣</strong><br>
                            <span style="color: #666; font-size: 0.9rem;">厉害、能干</span>
                        </div>
                        <div style="background: #f8f9fa; padding: 1rem; border-radius: 8px; text-align: center;">
                            <strong style="color: #764ba2;">嘹咂咧</strong><br>
                            <span style="color: #666; font-size: 0.9rem;">很好、很棒</span>
                        </div>
                        <div style="background: #f8f9fa; padding: 1rem; border-radius: 8px; text-align: center;">
                            <strong style="color: #764ba2;">娃</strong><br>
                            <span style="color: #666; font-size: 0.9rem;">孩子、年轻人</span>
                        </div>
                        <div style="background: #f8f9fa; padding: 1rem; border-radius: 8px; text-align: center;">
                            <strong style="color: #764ba2;">伙计</strong><br>
                            <span style="color: #666; font-size: 0.9rem;">朋友、哥们</span>
                        </div>
                        <div style="background: #f8f9fa; padding: 1rem; border-radius: 8px; text-align: center;">
                            <strong style="color: #764ba2;">寻</strong><br>
                            <span style="color: #666; font-size: 0.9rem;">找、寻找</span>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </main>

    <footer class="footer">
        <div class="container">
            <p>&copy; 2024 西安文化体验网站. 探索古都魅力，传承文化精神.</p>
        </div>
    </footer>

    <script>
        let currentAudio = null;
        let currentButton = null;
        
        function toggleAudio(audioId, button) {
            const audio = document.getElementById(audioId);
            const progressBar = document.getElementById('progress' + audioId.slice(-1));
            const timeDisplay = document.getElementById('time' + audioId.slice(-1));
            
            // 如果有其他音频在播放，先停止
            if (currentAudio && currentAudio !== audio) {
                currentAudio.pause();
                currentAudio.currentTime = 0;
                if (currentButton) {
                    currentButton.textContent = '▶️';
                }
            }
            
            if (audio.paused) {
                audio.play();
                button.textContent = '⏸️';
                currentAudio = audio;
                currentButton = button;
                
                // 更新进度条
                audio.addEventListener('timeupdate', function() {
                    const progress = (audio.currentTime / audio.duration) * 100;
                    progressBar.style.width = progress + '%';
                    
                    const currentTime = formatTime(audio.currentTime);
                    const duration = formatTime(audio.duration);
                    timeDisplay.textContent = `${currentTime} / ${duration}`;
                });
                
                // 播放结束时重置
                audio.addEventListener('ended', function() {
                    button.textContent = '▶️';
                    progressBar.style.width = '0%';
                    currentAudio = null;
                    currentButton = null;
                });
                
            } else {
                audio.pause();
                button.textContent = '▶️';
                currentAudio = null;
                currentButton = null;
            }
        }
        
        function formatTime(seconds) {
            if (isNaN(seconds)) return '00:00';
            const mins = Math.floor(seconds / 60);
            const secs = Math.floor(seconds % 60);
            return `${mins.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`;
        }
        
        // 页面加载时初始化音频时长显示
        document.addEventListener('DOMContentLoaded', function() {
            const audios = ['audio1', 'audio2', 'audio3'];
            audios.forEach((audioId, index) => {
                const audio = document.getElementById(audioId);
                const timeDisplay = document.getElementById('time' + (index + 1));
                
                audio.addEventListener('loadedmetadata', function() {
                    const duration = formatTime(audio.duration);
                    timeDisplay.textContent = `00:00 / ${duration}`;
                });
            });
        });
    </script>
    <script src="script.js"></script>
</body>
</html>